<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="Content-Language" content="en-us">
	<title>ini Test</title>
	<script language="JavaScript" type="text/JavaScript">
		function GetBrowserType(){
			var Sys = {};
			var ua = navigator.userAgent.toLowerCase();
			var s;
			(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
			(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
			(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
			(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
			(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
			return Sys;
		};
		
		function initCommObject(id, clsid, codebase)
		{
			var SysBrowser = GetBrowserType();
			document.write('<object id="' + id + '"');
			if (SysBrowser.firefox){
				document.write('type="application/x-itst-activex"');
				document.write('clsid="{' + clsid + '}" ');
			} else {
				document.write('type="application/x-oleobject"');
				document.write('classid="clsid:' + clsid + '"');
			}
			document.write('codebase="' + codebase + '" style="left: 54px; top: 14px" >');
			document.write('</object>');
		}
	</script>
	<script language="javascript">
		function iniFileGetValue(){
			//这里设置才生效
			var INI_OCX = document.getElementById('INI_OCX');
			INI_OCX.INIFile = "c:\\temp\\test.ini";
			//INI_OCX.Refresh();
			var servip = INI_OCX.GetValue("tux", "serverip");
			alert("serverip is :" + servip);		
		}
		
	</script>
<!--
<object id="INI_OCX" classid="clsid:B585EB19-9F90-11D2-9537-000000000000" codebase="ARINIMgr.dll"
        type="application/x-oleobject">
		<param name="INIFile" value="c:\\temp\\test.ini" />
</object>
-->
</head>

<body>
<form>
	<script language="JavaScript" type="text/JavaScript">
		initCommObject('INI_OCX', 'B585EB19-9F90-11D2-9537-000000000000', 'ARINIMgr.dll');
	</script>
	<fieldset style="width: 200px; height: 250px; text-align: center;">
		<legend>ini内容</legend>
		<div style="float: left;">
			<textarea id="txtIni" name="txtIni" style="width: 200px; height: 160px"></textarea>
			<br />
			<span>
			<input id="isSendHex" name="isSendHex" type="checkbox" checked="0" />16进制</span>
			<input type="button" id="readIni" style="width: 100px; height: 30px" name="SendButton" value="读取" onclick="iniFileGetValue()">
		</div>
	</fieldset>
</form>
</body>
</html>